package com.dsr.dao;

import com.dsr.entity.Spit;
import org.springframework.data.domain.Example;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.data.mongodb.repository.MongoRepository;

/**
 * (Spit)表数据库访问层
 *
 * @author dsr
 * @since 2020-09-20
 */
public interface SpitDao extends MongoRepository<Spit, String> {
    int countSpitByFlowerId(String flowerId);

    Page<Spit> findAllByFlowerIdAndRateBetween(String flowerId, int start, int end,Pageable pageable);
    Page<Spit> findAllByFlowerIdAndImgUrlStartsWith(String flowerId,String val, Pageable pageable);
    Integer countByImgUrlStartsWith(String start);
    Integer countByRateBetween(int start, int end);
}